// 用户状态枚举
export enum UserStatus {
  DISABLED = 0,
  ENABLED = 1
}

// 用户基础信息
export interface UserBase {
  username: string
  password?: string
  realName: string
  phone: string
  email: string
  status: number
  deptId?: number
  deptName?: string
  avatar?: string
}

// 用户信息
export interface UserInfo extends UserBase {
  id: number
  createTime?: string
  updateTime?: string
  roles?: RoleInfo[]
}

// 角色信息
export interface RoleInfo {
  id: number
  roleName: string
  roleCode: string
}

// 分页参数
export interface PageParams {
  pageNum?: number
  pageSize?: number
  orderField?: string
  orderType?: string
}

// 分页结果
export interface PageResult<T> {
  data: any
  records: T[]
  total: number
  size: number
  current: number
  pages: number
  orders: any[]
  optimizeCountSql: boolean
  searchCount: boolean
  maxLimit: number | null
  countId: string | null
}

// 用户查询参数
export interface UserQuery {
  current?: number
  size?: number
  orderField?: string
  orderType?: string
  username?: string
  realName?: string
  phone?: string
  email?: string
  status?: number
  deptId?: number
}

// 重置密码参数
export interface ResetPasswordParams {
  userId: number
  password: string
}

// 分配角色参数
export interface AssignRoleParams {
  userId: number
  roleIds: number[]
}

// API响应
export interface ApiResponse<T = any> {
  code: number
  msg: string
  data: T
} 